{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "irish-songsmoredata.ipynb",
      "provenance": [],
      "include_colab_link": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "accelerator": "TPU"
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/lmoroney/tfbook/blob/master/chapter8/irish-songs-moredata.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "zX4Kg8DUTKWO",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "#@title Licensed under the Apache License, Version 2.0 (the \"License\");\n",
        "# you may not use this file except in compliance with the License.\n",
        "# You may obtain a copy of the License at\n",
        "#\n",
        "# https://www.apache.org/licenses/LICENSE-2.0\n",
        "#\n",
        "# Unless required by applicable law or agreed to in writing, software\n",
        "# distributed under the License is distributed on an \"AS IS\" BASIS,\n",
        "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n",
        "# See the License for the specific language governing permissions and\n",
        "# limitations under the License."
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "D1J15Vh_1Jih",
        "colab_type": "code",
        "cellView": "both",
        "colab": {}
      },
      "source": [
        "try:\n",
        "  # %tensorflow_version only exists in Colab.\n",
        "  %tensorflow_version 2.x\n",
        "except Exception:\n",
        "  pass\n"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "BOjujz601HcS",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "import tensorflow as tf\n",
        "\n",
        "from tensorflow.keras.preprocessing.sequence import pad_sequences\n",
        "from tensorflow.keras.layers import Embedding, LSTM, Dense, Bidirectional\n",
        "from tensorflow.keras.preprocessing.text import Tokenizer\n",
        "from tensorflow.keras.models import Sequential\n",
        "from tensorflow.keras.optimizers import Adam\n",
        "import numpy as np "
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "tq0_KqNPaCjQ",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "!wget --no-check-certificate \\\n",
        "    https://storage.googleapis.com/learning-datasets/irish-lyrics-eof.txt \\\n",
        "    -O /tmp/irish-lyrics-eof.txt"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "rNHCNxGLZx99",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "tokenizer = Tokenizer()\n",
        "max_sequence_len = 6\n",
        "sentences=[]\n",
        "alltext=[]\n",
        "data = open('/tmp/irish-lyrics-eof.txt').read()\n",
        "corpus = data.lower()\n",
        "alltext.append(corpus)\n",
        "words = corpus.split(\" \")\n",
        "range_size = len(words)-max_sequence_len\n",
        "for i in range(0, range_size):\n",
        "\tthissentence=\"\"\n",
        "\tfor word in range(0, max_sequence_len-1):\n",
        "\t\tword = words[i+word]\n",
        "\t\tthissentence = thissentence + word\n",
        "\t\tthissentence = thissentence + \" \"\n",
        "\tsentences.append(thissentence)\n",
        "\n",
        "oov_tok = \"<OOV>\"\n",
        "vocab_size=2700\n",
        "tokenizer = Tokenizer(num_words=vocab_size, oov_token=oov_tok, split=\" \", char_level=False)\n",
        "tokenizer.fit_on_texts(alltext)\n",
        "total_words = len(tokenizer.word_index) + 1\n",
        "\n",
        "print(tokenizer.word_index)\n",
        "print(total_words)\n",
        "\n",
        "input_sequences = []\n",
        "for line in sentences:\n",
        "\ttoken_list = tokenizer.texts_to_sequences([line])[0]\n",
        "\tfor i in range(1, len(token_list)):\n",
        "\t\tn_gram_sequence = token_list[:i+1]\n",
        "\t\tinput_sequences.append(n_gram_sequence)\n",
        "\n",
        "# pad sequences \n",
        "#max_sequence_len = max([len(x) for x in input_sequences])\n",
        "input_sequences = np.array(pad_sequences(input_sequences, maxlen=max_sequence_len, padding='pre'))\n",
        "\n",
        "# create predictors and label\n",
        "xs, labels = input_sequences[:,:-1],input_sequences[:,-1]\n",
        "\n",
        "ys = tf.keras.utils.to_categorical(labels, num_classes=total_words)"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "8BG-akbfR_MI",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "print(xs.shape)"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "NU58xi445Bjt",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "print(xs[:20])"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "uHMeH7mEgJ-X",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "model = Sequential()\n",
        "model.add(Embedding(total_words, 16, input_length=max_sequence_len-1))\n",
        "model.add(Bidirectional(LSTM(32, return_sequences=True)))\n",
        "model.add(Bidirectional(LSTM(32)))\n",
        "model.add(Dense(total_words, activation='softmax'))\n",
        "adam = Adam(lr=0.01)\n",
        "model.compile(loss='categorical_crossentropy', optimizer=adam, metrics=['accuracy'])\n",
        "history = model.fit(xs, ys, epochs=100, verbose=1)\n",
        "model.save(\"bidiirish2.h5\")"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "3YXGelKThoTT",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 541
        },
        "outputId": "64236e26-f497-4123-b87e-5d1741edf34b"
      },
      "source": [
        "import matplotlib.pyplot as plt\n",
        "\n",
        "\n",
        "def plot_graphs(history, string):\n",
        "  plt.plot(history.history[string])\n",
        "  plt.xlabel(\"Epochs\")\n",
        "  plt.ylabel(string)\n",
        "  plt.show()\n",
        "\n",
        "plot_graphs(history, 'accuracy')\n",
        "plot_graphs(history, 'loss')\n"
      ],
      "execution_count": 36,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEGCAYAAABo25JHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nO3deXxcdb3/8dcne5qmaZqm6d6ktHSnLYQWRJFVCkhxQQVRAcW6oXjVq9zr7+fuzwWvXvXigggCKhVQvL2IcKGAULYutBS6h7Rp06bNvu+Zz++PmZZpm8AUM5kk5/18PPIg58yZmc/JKfOe8/1+z/eYuyMiIsGVlOgCREQksRQEIiIBpyAQEQk4BYGISMApCEREAi4l0QWcqLFjx3phYWGiyxARGVI2bNhQ7e75vT025IKgsLCQ9evXJ7oMEZEhxczK+npMTUMiIgGnIBARCTgFgYhIwCkIREQCTkEgIhJwCgIRkYBTEIiIBJyCQEQGvXV7aln10gFCIU2bHw9xvaDMzJYBPwWSgdvc/fu9bPN+4BuAAy+5+wfjWZOIJJa7s+VAI9PyRpCdkXrUYzXNHQDkjUwHIBRyfvFkCT9+dCchhzuf3cN33jWfORNGxfReDa1d/O/Wg2wub+DzF8w88roDpb2rhzW7qtl+sJEdh5oB+L/vnMO47IyYn5+RmhzPEoE4BoGZJQO3ABcC5cA6M1vl7lujtpkJ/BtwlrvXmdm4eNUjIn3bfrCRioZ2zp6ZT3KSHfVYR3cPe2taKa1uoaymhQP17eyvb6O5vZszpufxjnkFzB6fjdnRz6tsauf7D21nRHoyCyePZvb4UTz7ajV/Wr+P0qoW5kwYxT0fX8roEWkA7DzUxFW3Pk9daydnzRjLO0+ZwN9fOciTO6p416KJnHlSHj94eAfv/Pka3l88mWXzJ7C0aMxxH5TuzpqSam5fs5s1JdV09YTPIrZWNPKH65e+4Qfr7uoWfv74Ljq6QowblU7BqAwuXTCBKWNG9Pmc9q4ekpOM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C6CJ/9fayvYwsY4VGRrwIvEx5RdULvpykmREQCLihNQyIi0gcFgYhIwCkIREQCTkEgIhJwCgIRkYBTEIhEmFmPmW2K+um3CdvMrDB6JkmRwSTljTcRCYw2d1+U6CJEBprOCETegJntMbMfmtnLZrbWzGZE1hea2eOROeBXm9nUyPoCM3vAzF6K/Lwl8lLJZvabyFz6/2tmmZHtPxe5h8RmM1uZoN2UAFMQiLwm85imoQ9EPdbg7guA/yI82ynAz4E73f0U4A/AzyLrfwb8w90XEp7/Z0tk/UzgFnefB9QD742svwlYHHmdT8Zr50T6oiuLRSLMrNndR/ayfg9wnruXRib1O+jueWZWDUxw967I+gp3H2tmVcBkd++Ieo1C4FEP31QEM/sKkOru3zGzh4FmwtNE/NXdm+O8qyJH0RmBSGy8j99PREfU7z281kd3KeG5Yk4F1kXNoikyIBQEIrH5QNR/n4v8/izhGU8Brgaejvy+GvgUHLmXck5fL2pmScAUd38C+AqQAxx3ViIST/rmIfKaTDPbFLX8sLsfHkKaa2abCX+rvyqy7rOE7xD2r4TvFnZdZP2NwK1m9jHC3/w/RXgmyd4kA7+PhIUBP/PwLSdFBoz6CETeQKSPoNjdqxNdi0g8qGlIRCTgdEYgIhJwOiMQEQk4BYGISMApCEREAk5BICIScAoCEZGA+//t51sUeflK2AAAAABJRU5ErkJggg==\n",
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": [],
            "needs_background": "light"
          }
        },
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAEGCAYAAABvtY4XAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nO3de3hcd33n8fd3NLqNNBrrLtmyLTu+O7GT2HGcC2kukIaQQrmVW2kJPJstS1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vz7TPrzX5KavRLgI8DT6c8fAz4J4/eJTZzuRc0sAu8xcAgAAACSSURBVMx39yeAPwYSwOveRYgESUcUkg0KzezFCY8fcvcTQyVLzexlUkfhH0ov+z1Sd1P6HKk7K92aXv5p4C4z+wSpI/VPkpoVcDI5wHfSfwQMuNNTt90TOW/Ug5esle7Br3f3Y5muRSQIatGIiISUjuBFREJKR/AiIiGlgBcRCSkFvIhISCngRURCSgEvIhJS/x9irFJdhc13LwAAAABJRU5ErkJggg==\n",
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": [],
            "needs_background": "light"
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "oh8ZdMXVgvCm",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "seed_text = \"sweet jeremy saw dublin\"\n",
        "\n",
        "token_list = tokenizer.texts_to_sequences([seed_text])[0]\n",
        "token_list = pad_sequences([token_list], maxlen=max_sequence_len-1, padding='pre')\n",
        "#print(model.predict(token_list))  \n",
        "predicted = model.predict_classes(token_list)\n",
        "pred_classes=model.predict(token_list)\n",
        "print(pred_classes.reshape(-1)[predicted])\n",
        "print(predicted)\n",
        "for word, index in tokenizer.word_index.items():\n",
        "\tif index == predicted:\n",
        "\t\tprint(word)\n",
        "\t\tbreak"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "6Vc6PHgxa6Hm",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 54
        },
        "outputId": "4853ff58-839e-4f2b-f66a-f5c7cbe43579"
      },
      "source": [
        "seed_text = \"are you feeling lucky\"\n",
        "next_words = 100\n",
        "\n",
        "  \n",
        "for _ in range(next_words):\n",
        "\ttoken_list = tokenizer.texts_to_sequences([seed_text])[0]\n",
        "\ttoken_list = pad_sequences([token_list], maxlen=max_sequence_len-1, padding='pre')\n",
        "\tpredicted = model.predict_classes(token_list, verbose=0)\n",
        "\toutput_word = \"\"\n",
        "\tfor word, index in tokenizer.word_index.items():\n",
        "\t\tif index == predicted:\n",
        "\t\t\toutput_word = word\n",
        "\t\t\tbreak\n",
        "\tseed_text += \" \" + output_word\n",
        "print(seed_text)"
      ],
      "execution_count": 35,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "are you feeling lucky the hail the morning air where the place where we sat side by them spend oh my kellswater so fair for this one shadow on my wild throbbing breast hid her thousand treasures with such yet was seen for the song of the star of the very next day and mother i eyes are smiling sure tis like the morn in spring the landlord and the storied evening after live oh shed a tear in the high rocky slopes round the red came and slower and they would support her could not bring rosin the wheel leave where i was\n"
          ],
          "name": "stdout"
        }
      ]
    }
  ]
}